<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>登录-拼团商城</title>
<style>
  body{
   margin:0;
      height:100vh;
      display: flex;
      justify-content:center ;
      align-items:center;
      background: linear-gradient(135deg, #f3f4f6, #e2e8f0);
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  }

  .login-container {
      background: white;
      border-radius: 20px;
      padding: 40px 50px;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
      width: 360px;
      animation: fadeInUp 0.6s ease-out forwards;
      opacity: 0;
      transform: translateY(40px);
  }

  @keyframes fadeInUp {
      to {
          opacity: 1;
          transform: translateY(0);
      }
  }
  h2 {
      margin-bottom: 30px;
      color: #2e2e2e;
      text-align: center;
  }
  input {
      width: 100%;
      padding: 12px 15px;
      margin: 10px 0;
      border: 1px solid #dcdfe6;
      border-radius: 10px;
      font-size: 14px;
      transition: border 0.3s;
  }
  input:focus {
      border-color: #409EFF;
      outline: none;
  }
  .btn {
      width: 100%;
      padding: 12px;
      background: linear-gradient(to right, #667eea, #764ba2);
      color: white;
      border: none;
      border-radius: 12px;
      font-size: 16px;
      font-weight: bold;
      cursor: pointer;
      margin-top: 20px;
      transition: transform 0.2s, box-shadow 0.3s;
  }

  .btn:hover {
      transform: scale(1.03);
      box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
  }

  .link {
      text-align: center;
      margin-top: 20px;
      font-size: 13px;
  }

  .link a {
      color: #667eea;
      text-decoration: none;
  }

  .error {
      color: #e74c3c;
      background: #ffeae9;
      border: 1px solid #f5c6cb;
      padding: 10px;
      border-radius: 8px;
      margin-bottom: 15px;
      text-align: center;
      font-size: 13px;
  }
</style>
</head>
<div class="login-container">
    <h2>用户登录</h2>

    <c:if test="${not empty error}">
        <div class="error">${error}</div>
    </c:if>

    <form action="${pageContext.request.contextPath}/front/login" method="post">
        <input name="username" placeholder="用户名" required />
        <input name="password" type="password" placeholder="密码" required />
        <button type="submit" class="btn">立即登录</button>
    </form>

    <div class="link">
        没有账号？<a href="${pageContext.request.contextPath}/front/register">立即注册</a>
    </div>
</div>
    </html>